import os

from dotenv import load_dotenv

load_dotenv()


class CacheConfig:
    CACHE_TYPE = os.getenv('CACHE_TYPE') or 'redis'
    CACHE_REDIS_HOST = os.getenv('CACHE_REDIS_HOST') or '127.0.0.1'
    CACHE_REDIS_PORT = os.getenv('CACHE_REDIS_PORT') or 6379
    CACHE_REDIS_DB = os.getenv('CACHE_REDIS_DB') or 0
    CACHE_REDIS_PASSWORD = os.getenv('CACHE_REDIS_PASSWORD') or None
    CACHE_THRESHOLD = os.getenv('CACHE_THRESHOLD') or 0
    CACHE_KEY_PREFIX = os.getenv('CACHE_KEY_PREFIX') or 'APP:CACHE:'

    # 连接池配置
    # CACHE_REDIS_CONNECTION_POOL = True
    # CACHE_REDIS_SOCKET_CONNECT_TIMEOUT = 5
    # CACHE_REDIS_SOCKET_TIMEOUT = 5
    # CACHE_REDIS_HEALTH_CHECK_INTERVAL = 30
